<?php


namespace App\Admin\Table;

use Dcat\Admin\Grid\LazyRenderable;
use App\Models\MemberBenefitModel;
use Dcat\Admin\Grid;

class QyTable extends LazyRenderable
{

    public function grid(): Grid
    {

        return Grid::make(MemberBenefitModel::query(), function (Grid $grid) {
            //            控制按钮
            $grid->disableCreateButton();
            $grid->disableDeleteButton();
            $grid->tools(function ($tools) {
                $tools->batch(function ($batch) {
                    $batch->disableDelete();
                });
            });
            $grid->actions(function (Grid\Displayers\Actions $actions) {
                $actions->disableDelete();
                $actions->disableEdit();
                $actions->disableQuickEdit();
                $actions->disableView();
            });
            $grid->column('name','权益名称');
            $grid->column('desc','权益说明');
            $grid->disableActions();
            $grid->filter(function (Grid\Filter $filter) {
            });
        });
    }
}
